libxenlight: initialize enum to 1, to prevent defaulting to the 0
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 14 Jan 2010 09:40:55 +0000 (09:40 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 14 Jan 2010 09:40:55 +0000 (09:40 +0000)
values when structure when not properly initialized by the client.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/libxl/libxl.h
tools/libxl/libxl_internal.h

index 529dbd6de2ac24d0bc00889f2822c21d19b06b2e..25a66d9bf87443d562bfab69d41a318931714b8d 100644 (file)
@@ -104,7 +104,7 @@ typedef struct {
 } libxl_domain_suspend_info;
 
 typedef enum {
-    XENFV,
+    XENFV = 1,
     XENPV,
 } libxl_qemu_machine_type;
 
@@ -169,7 +169,7 @@ typedef struct {
 } libxl_device_console;
 
 typedef enum {
-    PHYSTYPE_QCOW,
+    PHYSTYPE_QCOW = 1,
     PHYSTYPE_QCOW2,
     PHYSTYPE_VHD,
     PHYSTYPE_AIO,
@@ -189,7 +189,7 @@ typedef struct {
 } libxl_device_disk;
 
 typedef enum {
-    NICTYPE_IOEMU,
+    NICTYPE_IOEMU = 1,
     NICTYPE_VIF,
 } libxl_nic_type;
 
index 7664e592f724263bd19ff01cff06fbfcbbead3d1..11698bc04e4c9b7575c36dc28ba9c9f2ad97fb81 100644 (file)
@@ -59,7 +59,7 @@ void xl_log(struct libxl_ctx *ctx, int errnoval, int loglevel, const char *file,
 
 
 typedef enum {
-    DEVICE_VIF,
+    DEVICE_VIF = 1,
     DEVICE_VBD,
     DEVICE_TAP,
     DEVICE_PCI,